function updateTime() {
    var now = new Date();
    var year = now.getFullYear();
    var month = ('0' + (now.getMonth() + 1)).slice(-2);
    var day = ('0' + now.getDate()).slice(-2);
    var hours = now.getHours();
    var minutes = now.getMinutes();
    var seconds = now.getSeconds();
    var dateText = year + '-' + month + '-' + day;
    var timeText = ('0' + hours).slice(-2) + ':' + ('0' + minutes).slice(-2) + ':' + ('0' + seconds).slice(-2);
    document.querySelector('.date').textContent = dateText;
    document.querySelector('.time').textContent = timeText;
}
setInterval(updateTime, 0);